# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks-old
maintainer="team/kde <bribbers@disroot.org>"
pkgname=kactivities5
pkgver=5.116.0
pkgrel=0
# armhf blocked by qt5-qtdeclarative
arch="all !armhf"
pkgdesc="Core components for the KDE's Activities"
url="https://community.kde.org/Frameworks"
license="GPL-2.0-or-later AND LGPL-2.1-or-later AND (LGPL-2.1-only OR LGPL-3.0-only)"
depends="qt5-qtbase-sqlite"
depends_dev="
	kconfig5-dev
	kcoreaddons5-dev
	kwindowsystem5-dev
	qt5-qtdeclarative-dev
	"
makedepends="$depends_dev
	boost-dev
	doxygen
	extra-cmake-modules
	qt5-qttools-dev
	samurai
	"
subpackages="$pkgname-dev $pkgname-libs $pkgname-doc"
_repo_url="https://invent.kde.org/plasma/kactivities.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kactivities-$pkgver.tar.xz"
options="!check" # No tests
builddir="$srcdir/kactivities-$pkgver"

replaces="kactivities<=5.110.0-r0"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

libs() {
	# workaround: need to specify replaces, otherwise upgrade will fail
	replaces="kactivities-libs<=5.110.0-r0"
	default_libs
}

sha512sums="
d36755cbf3e28262086da2d737c99eb6829c75c374972b97f8dfa7ba0f5d2c02c4d00e833702d23c04d02a6883d14735950cbdc0d92bb6dfa3fe615a488d5adf  kactivities-5.116.0.tar.xz
"
